using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace ClientGUI.Modules.Drawing
{
    /// <summary>
    /// DisplayAreas are used to encapsulate the idea of a Composition element.  Members of this
    /// class must be able to Composite onto a Graphics object.  Used by Modules to do drawing, and
    /// all rendering should be done by members of this class.
    /// </summary>
    public abstract class DisplayArea : IDisposable
    {
        /// <summary>
        /// This method must be overridden by all subclasses to draw
        /// onto the graphics provided.  The clip rectangle is specifyng what
        /// part of the module must be displayed on the graphics, it is in
        /// terms of module dimensions.
        /// </summary>
        /// <param name="displayArea">Graphics to draw onto</param>
        /// <param name="cr">Clip Rectangle of this module</param>
        /// <param name="offset">offset to display from on the graphics
        /// context</param>
        public abstract void Composite(Graphics displayArea, 
                                       Rectangle cr,
                                       Point offset);

        #region IDisposable Members

        /// <summary>
        /// Allow for deletion of expensive memory
        /// </summary>
        public virtual void Dispose()
        {
            //do nothing
        }

        #endregion
    }
}
